﻿@using MileageStats.Web;
@using System.Web.WebPages;

@{
    var isOverriden = ViewContext.HttpContext.GetOverriddenUserAgent() != ViewContext.HttpContext.Request.UserAgent;
}

@if (ViewContext.HttpContext.GetOverriddenBrowser().IsMobileDevice)
{
<p class="switch">
    <a href="@Url.Action("SwitchView", "ViewSwitcher", new { mobile = false, returnUrl = Request.Url.PathAndQuery })" rel="external">
        <span>Switch to desktop site</span> </a>
</p>
}
else if (isOverriden)
{
@Html.ActionLink("[ Switch to Mobile ]", "SwitchView", "ViewSwitcher", new { mobile = true, returnUrl = Request.Url.PathAndQuery }, new { id = "view_switcher", rel = "external" })
}